{template Public:Page:header}
<style type="text/css">
input[type="checkbox"], input[type="radio"] {
	opacity: 1;
	position: static;
}
</style>

<form id="PayForm" action="/post/consume/payin" method="post">

<link rel="stylesheet" type="text/css" href="/assets/css/pay_logo.css"/>

<div class="container">
  <div class="row"> 
  {template Member:Index:sidebar}
    <div class="col-lg-10 well-col-pl-30">
      <div class="row">
        <div class="well">
          <h3>充值</h3>
          
             
             <div style="margin-left:2px;">
                  <ul id="PayTab" class="nav nav-tabs tabs-flat">
                    <li>
                        <a href="/member/payin/index">
                            支付宝
                        </a>
                    </li>
                    <li class="active">
                        <a href="/member/payin/tenpay">
                            财付通
                        </a>
                    </li>
                    <li>
                        <a href="/member/payin/list">
                           充值记录
                        </a>
                    </li>
                </ul>
             </div>
             
           <div class="tab-content tabs-flat"><div class="tab-pane in active">

              <div class="row">
              
               <div id="tenpayBankList" class="bank_list"></div>
                <script>
				 $(function(){
					 $.getScript("http://union.tenpay.com/bankList/bank.js");
				 });
                 </script>
                          <input type="hidden" name="bank_type" id="bank_type_value" value="0">
                          
              </div>
              
           </div></div>
          
          
           <div class="row">
          <div class="col-lg-2">
          <h4>充值金额(元)</h4>
          </div>
           <div class="col-lg-3">
           <input type="text" name="money" id="PayMoney" class="form-control" value="{if $_GET['pay']}{echo floatval($_GET['pay'])}{else}{echo C('pay_small_money')}{/if}" maxLength="12" size="14"/>
            </div>
             <div class="col-lg-2">
              <button class="btn btn-azure" type="submit" onclick="return CheckPay();">确定充值</button>
              <input name="bank" type="hidden" value="" />
              <input name="type" type="hidden" value="2" />
             </div>
  
		  </div>
          
          <br />
          
          <br />

        </div>
          
      </div>
    </div>
  </div>
</div>
</div>
</form>

<script src="{echo AURL}/js/validation/bootstrapValidator.js"></script>

<script type="text/javascript">
function CheckPay(){
	  var paymoney=$("#PayMoney").val();
	 
	  if (isNaN(paymoney)){
		  alert("您输入的金额格式错误，请重新输入!");
		  $("#PayMoney").focus();
		  return false;
	  }	
	  
	 var paysmall=parseInt({echo C("pay_small_money")});
	
	 if(paysmall > parseInt(paymoney)){
		 alert("充值金额不能小于 "+paysmall+" 元!");
		 $("#PayMoney").focus();
		 return false; 
	 }
	 
	 var bank=$('#bank_type_value').val();
	 
	 $('input[name="bank"]').val(bank);
 
	 return true; 
}
$(function(){ 
	$('#PayForm').bootstrapValidator({
		excluded: [':disabled'],
		feedbackIcons: {
			valid: 'glyphicon glyphicon-ok',
			invalid: 'glyphicon glyphicon-remove',
			validating: 'glyphicon glyphicon-refresh'
		},
		fields: {
			money: {
				validators: {
					notEmpty: {
						message: '金额不能为空！'
					},
					regexp: {
						regexp: /^[0-9]+$/,
						message: '金额格式有误！'
					}
				}
			}
			
		}
	}) 			
	 
});	
</script>
	
{template Public:Page:footer}